# -*- coding: utf-8 -*-
# @Author : HaleShi
# @Time : 2023-04-20
# @File : 8.字符串拼接脚本.py

info = {
    "aid": "99888",
    "cid": "xxxxx",
    "did": "bbbbb",
    "build": "123456"
}
datalist = []
for k, v in info.items():
    ele = f"{k}={v}"
    datalist.append(ele)
print(datalist)
result = "&".join(datalist)
print(result)

# 因为java有排序 在python中需要sorted来调整,sorted是根据acill码点进行排序
resultTwo = "&".join([f"{key}={info[key]}" for key in sorted(info.keys())])
print(resultTwo)
